home *** CD-ROM | disk | FTP | other *** search
- property theSlider
- property IndexSize
- property indexRect
- property VolumeBar
- property ancestor
- property theVolumeIndex
- property CreditsTimer
- property CreditsInterval
- property CreditsPageIndex
- property CreditsPage
- property savedCreditsLocation
-
- on Birth me, theChannelObject, theName, thePageInfo
- set the ancestor of me to Birth( script "Master Page Template", theChannelObject, theName, thePageInfo, true, true )
-
- set theVolumeIndex to the soundlevel -- GetPreference( #SoundVolume )
-
- set Volumebar to FindDisplay( me, "V" )
-
- set theClickArea to FindButton( me, "ClickArea" )
- set the soundname of theClickArea to ""
-
- set theSlider to FindButton( me, "VTHUMB" )
- set the trackable of theSlider to true
- set the trackRect of theSlider to rect( 185, 118, 185, 310 )
- set indexRect to rect( 185, 108, 185, 320 )
- set IndexSize to ( ( the bottom of indexRect - the top of indexRect ) / 8 )
- set the soundname of theSlider to ""
-
- set CreditsTimer to the Ticks
- set CreditsInterval to 6 * 60
- set CreditsPageIndex to "1"
- set CreditsPage to FindDisplay( me, "CreditsPage" )
- setink( CreditsPage, #copy )
- set savedCreditsLocation to the location of CreditsPage
- Move( CreditsPage, Point(-1000,-1000) )
-
- SetSlider me
- Show me
- return me
- end
-
- on Leave me
- WritePreferences()
- end
-
- on SetSlider me
- set theLocation to duplicate(the location of theslider)
- set theLocV to the bottom of indexRect - ( theVolumeIndex * IndexSize ) - ( IndexSize / 2 )
- setat( theLocation, 2, theLocV )
- move( theSlider, theLocation )
- set the soundLevel to theVolumeIndex
- playsound( "Basic Button" )
- if theVolumeIndex >= 0 then
- SetCastName( VolumeBar, "V" & theVolumeIndex )
- Show( VolumeBar )
- else
- Hide( VolumeBar )
- end if
- end
-
- on PageIdle me
- PageIdle the ancestor of me
-
- if CreditsTimer + CreditsInterval < the ticks then
- case CreditsPageIndex of
- "1":
- set CreditsPageIndex to "2"
- SetCastName( CreditsPage, "VOL_2" )
- Move( CreditsPage, savedCreditsLocation )
- "2":
- set CreditsPageIndex to "3"
- SetCastName( CreditsPage, "VOL_3" )
- "3":
- set CreditsPageIndex to "4"
- SetCastName( CreditsPage, "VOL_4" )
- "4":
- Move( CreditsPage, Point(-1000,-1000) )
- set CreditsPageIndex to "1"
- end case
- set CreditsTimer to the ticks
- show me
- end if
- end
-
- on ChangePage me, theElementID, theValue1, theValue2
- ChangePage( the ancestor of me, theElementID, theValue1, theValue2 )
- case theElementID of
- #Cancel:
- set the soundLevel to GetPreference( #SoundVolume )
- QueueCommand([[ #GoBack ]] )
- #Done:
- SetPreference( #SoundVolume, theVolumeIndex )
- QueueCommand([[ #GoBack ]] )
- #VolumeClick:
- set theMouseV to the mousev
- if theMouseV > the bottom of indexRect then
- set theMouseV to the bottom of indexRect
- end if
- if theMouseV < the top of indexRect then
- set theMouseV to the top of indexRect
- end if
- set theVolumeIndex to ( ( the bottom of indexRect - theMouseV ) / IndexSize )
- put theVolumeIndex
- SetSlider me
- #VolumeSlider:
- set theLocation to the location of theslider
- set theVolumeIndex to ( ( the bottom of indexRect - getat( theLocation, 2 ) ) / IndexSize )
- put theVolumeIndex
- SetSlider me
- end case
- end